package live.common;


import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import live.cz.dao.ProductQuery;
import live.cz.response.XmlFormart;

import org.apache.log4j.Logger;





public class ServerListener implements ServletContextListener {
	
	private String xmlStr = "";
	private Logger log = Log4jXmlConfig.getInstance().returnLogger(ServerListener.class);
	public void contextDestroyed(ServletContextEvent arg0) {
		// TODO Auto-generated method stub
	}

	public void contextInitialized(ServletContextEvent event) {
		// TODO Auto-generated method stub
//		if (XmlFormart.returnFileState() == false) {
			try {
				xmlStr = new ProductQuery().returnResponse();
				XmlFormart.returnProducts(xmlStr);
			} catch (Exception e) {
				// TODO Auto-generated catch block
			}
		}
//	}

}
